using System.IO;
using System.Text;

namespace System.Lua.Tests
{
    public class LuaWriterTest
    {
        protected static string GetLuaWriterResult(Action<LuaWriter> action)
        {
            var stringBuilder = new StringBuilder();

            using (var stringWriter = new StringWriter(stringBuilder))
            using (LuaWriter luaWriter = LuaWriter.Create(stringWriter))
            {
                action(luaWriter);
            }

            return stringBuilder.ToString();
        }
    }
}